import request from '../../utils/request'


/**
 * 分页获取海关列表
 * @param page
 * @returns {Promise.<void>}
 */
export async function getListForPage({ page }) {

    return request(apiPath.zbtim + "/api/customs", {
        method: 'get',
        data: {page: page.page, size: page.size}
    });
}


/**
 * 获取海关信息
 * @param id
 * @returns {Promise.<void>}
 */
export async function getById({id}) {

    return request(apiPath.zbtim + "/api/customs/" + id, {
        method: 'get'
    });
}


/**
 * 保存海关信息
 * @param data
 * @returns {Promise.<void>}
 */
export async function createCustoms(data) {
    return request(apiPath.zbtim + "/api/customs", {
        method: 'post',
        data
    });
}


/**
 * 更新海关信息
 * @param data
 * @returns {Promise.<void>}
 */
export async function updateCustoms( data ) {
    return request(apiPath.zbtim + "/api/customs", {
        method: 'put',
        data
    });
}


/**
 * 删除海关信息
 * @param id
 * @returns {Promise.<void>}
 */
export async function deleteCustoms({id}) {
    return request(apiPath.zbtim + "/api/customs/" + id , {
        method: 'delete'
    });
}
